package cluster.traversal;

import text.Text;
import text.traversal.ITextTraversal;

public class Normalize implements ITextTraversal
{

	private final String infoName;
	private final double divisor;
	
	public Normalize(double divisor, String infoName)
	{
		this.divisor = divisor;
		this.infoName = infoName;
	}
	
	public void traversal(String word, Text text)
	{
		double value = text.getInfo(infoName, word);
		
		text.addInfo(infoName, value / divisor);
	}

}
